home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 4
/
Precision Software Applications Silver Collection Volume 4 (1993).iso
/
stats
/
chadyn.exe
/
YRUELLET.C
< prev
next >
Wrap
Text File
|
1988-12-14
|
3KB
|
108 lines
/********************************* YRuelleT.c ********************************/
/*********************** (C) 1986,7,8 by JAMES A. YORKE **********************/
#include "yinclud.h"
static double rtA[5], rtB[5], rtJ[5], rtK[5];
/* cursor keys will move initialization point by this */
/* fraction of the screen. It can be changed by keys on the */
/* numeric key pad. */
mapRT() { /* map Q for Ruelle Takens
Quasiperiodicity study */
double X,
Y,
p1,
p2,
p1x,
p2x,
p1y,
p2y,
moduloAB(),
y_temp[6];
int i;
int base;
X = y[0];
Y = y[1];
p1 = rtA[1] *sin(twopi *(X + rtK[1]))
+ rtA[2] *sin (twopi *(Y + rtK[2]))
+ rtA[3] *sin(twopi *(X + Y + rtK[3]))
+ rtA[4] *sin (twopi *(X - Y + rtK[4]));
p2 = rtB[1] *sin(twopi *(X + rtJ[1]))
+ rtB[2] *sin (twopi *(Y + rtJ[2]))
+ rtB[3] *sin(twopi *(X + Y + rtJ[3]))
+ rtB[4] *sin (twopi *(X - Y + rtJ[4]));
y[0] = X + C1 + rho * p1 / twopi;
y[1] = Y + C2 + rho * p2 / twopi;
if(num_lyap > 0) {
p1x = rtA[1] *cos(twopi *(X + rtK[1]))
+ rtA[3] *cos(twopi *(X + Y + rtK[3]))
+ rtA[4] *cos (twopi *(X - Y + rtK[4]));
p1y = rtA[2] *cos (twopi *(Y + rtK[2]))
+ rtA[3] *cos(twopi *(X + Y + rtK[3]))
- rtA[4] *cos (twopi *(X - Y + rtK[4]));
p2x = rtB[1] *cos(twopi *(X + rtJ[1]))
+ rtB[3] *cos(twopi *(X + Y + rtJ[3]))
+ rtB[4] *cos (twopi *(X - Y + rtJ[4]));
p2y = rtB[2] *cos (twopi *(Y + rtJ[2]))
+ rtB[3] *cos(twopi *(X + Y + rtJ[3]))
- rtB[4] *cos (twopi *(X - Y + rtJ[4]));
for(i = 0; i < num_lyap; i++)
{ base = lyapzero + vec_dim *i;
y_temp[base] = y[base]
+ rho *(p1x *y[base] + p1y *y[base + 1]);
y_temp[base + 1] = y[base + 1]
+ rho *(p2x *y[base] + p2y *y[base + 1]);
}
for(i = lyapzero; i < lyapzero + vec_dim *num_lyap; i++)
y[i] = y_temp[i];
}
y[0] = moduloAB(y[0], 0., 1.);
y[1] = moduloAB(y[1], 0., 1.);
}
initRuelleTakens() {
vec_dim = 2; /* the dimension of the Lyapunov vectors =
phase space dim */
num_lyap = 0; /* the number of Lyapunov numbers to be
computed <=vec_dim */
lyapzero = 2; /* y[lyapzero] is the zeroth coord of the
zeroth lyapunov vector */
X_upper = 1.0; /* x scale */
X_lower = 0;
Y_upper = 1.0; /* y scale */
Y_lower = 0;
C1 = 42./ 100.;
C2 = 3./ 10.;
rho = 6./ 10.;
rtA[1] = -.2681366365;
rtA[2] = -.910675594;
rtA[3] =.3117202638;
rtA[4] = -.0400397884;
rtB[1] =.0881861167;
rtB[2] = -.5650288998;
rtB[3] =.1629954873;
rtB[4] = -.8039888198;
rtK[1] =.985460843;
rtK[2] =.5044604561;
rtK[3] =.9470747252;
rtK[4] =.233501055;
rtJ[1] =.9903072286;
rtJ[2] =.3363069701;
rtJ[3] =.2980492123;
rtJ[4] =.1550646728;
map = mapRT;
}